<template>
	<view class="container">
		<uni-list>
			<uni-list-item showExtraIcon="true" :extraIcon="{type: 'person-filled'}" title="用户名"
				:rightText="userInfo.nickName" />
			<uni-list-item showExtraIcon="true" :extraIcon="{type: 'phone-filled'}" title="手机号码" :rightText="phone" />
			<view class="head-image-box">
				<uni-icons type="person" size="15"></uni-icons>
				<text class="uni-list-item__content-title">头像</text>
				<image class="head-image" :src="userInfo.avatarUrl" mode="widthFix"></image>
			</view>


		</uni-list>
	</view>
</template>

<script>
	import {
		getUserDetailInfoApi
	} from '@/api/index.js'
	export default {
		data() {
			return {
				userInfo: {
					user_info: {}
				},
				roleGroup: "",
				postGroup: "",
				phone: ""
			}
		},
		onLoad() {
			this.userInfo = uni.getStorageSync('userInfo')
			this.phone = uni.getStorageSync('phone')
			// this.getUserDetailInfo(this.userInfo.id)
		},
		methods: {
			async getUserDetailInfo(id) {
				const {
					data: res
				} = await getUserDetailInfoApi(
					id
				)
				console.log(res);
				this.userInfo = res;
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #ffffff;
	}

	.head-image-box {
		display: flex;
		align-items: center;
		padding: 12px 15px;

		.uni-list-item__content-title {
			font-size: 14px;
			color: #3b4144;
			overflow: hidden;
			padding-right: 8px;
		}
	}

	.head-image {
		width: 100rpx;
		height: 100rpx;
	}
</style>